class: center, middle, inverse, title-slide # Disambiguating country names with {countrycode} --- layout: true <div class="dk-footer"> <span> <a href="https://rfortherestofus.com/" target="_blank">R for the Rest of Us </a> </span> </div> --- class: center, middle, dk-section-title background-image:url("images/translations.jpg") background-size: 100% # Disambiguating country names with {countrycode} ??? --- ## Why are country names complicated? There are 3 reasons that country names might vary between datasets: - Abbreviations - UK/United Kingdom, US/USA/United States, N. Cyprus/Northern Cyprus -- - Alternative (not disputed) names, i.e. formal vs informal - Netherlands/Holland, Kingdom of Bahrain/Bahrain, People's Republic of China/China -- - Disputed territories ??? --- ### Country codes are better than country names The only true way to disambiguate is to use country codes.
--- class: my-turn ## My Turn I'm going to use `{countrycode}` to disambiguate country names in a toy dataset and then use that to create a choropleth. ??? --- ## (RStudio Coding Slide) --- class: inverse ## Your Turn Combine the `rnaturalearthdata::countries110` dataset with `gapminder_2007` and create a choropleth comparing country populations. .pull-left[ - Use `countryname()` to add a column to `gapminder_2007` that contains the ISO3C country codes - Join together the `countries110` and `gapminder_2007` dataset using your new column - Use `mapview()` to visualise the `lifeExp` column ] .pull-right[
] ???